/**
 * Copyright (c) 2013 onionframework.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.onionframework.faces.extension;

import javax.faces.context.ExceptionHandler;

import com.sun.faces.context.ExceptionHandlerFactoryImpl;

/**
 * @author allan
 * 
 */
public class OnionExceptionHandlerFactory extends ExceptionHandlerFactoryImpl {

	private final javax.faces.context.ExceptionHandlerFactory parent;

	public OnionExceptionHandlerFactory(
			javax.faces.context.ExceptionHandlerFactory parent) {
		this.parent = parent;
	}

	@Override
	public ExceptionHandler getExceptionHandler() {
		ExceptionHandler result = parent.getExceptionHandler();
		result = new OnionExceptionHandler(result);
		return result;
	}

}
